#pragma once
#include <mysql/mysql.h>
#include <iostream>
#include <string>

/////////////////////////////////////////////////////////////////////////////////////////////
/*

    MySQL是一个数据库操作类
    
*/
class MySQL
{
public:
    MySQL();
    ~MySQL();
    /*············································

                    连接数据库
    
    ············································*/
    bool Connect();
    /*············································

                    更新操作
    
    ············································*/
    bool Update(const std::string& sql);
    /*············································

                    查询操作
    
    ············································*/
    MYSQL_RES* Query(const std::string& sql);
    /*············································

                    获取连接
    
    ············································*/
    MYSQL* GetConnection();
private:
    MYSQL* _conn;
};